package  
{
	import org.flixel.*;
	import org.flixel.plugin.photonstorm.*;
	
	/**
	 * ...
	 * @author le-ray_y
	 */
	public class Tower extends FlxSprite 
	{
		// Tower Graphics
		[Embed(source = '../../Assets/witch.png')]
		private static var _towerGraph:Class;
		
		// Max Health
		public var _maxHealth:Number;
		
		// Healthbar
		public var _hpBar:FlxBar;
		
		public function Tower(posX:Number = 0, posY:Number = 0, _health:Number = 100) 
		{
			// Initial Position
			this.x = posX;
			this.y = posY;
			
			// Health & Max Health
			this.health = _health;
			this._maxHealth = _health;
			
			// Graphic
			this.loadGraphic(_towerGraph, false, false, 219, 446);
			
			// Health Bar
			_hpBar = new FlxBar(617, 11, FlxBar.FILL_LEFT_TO_RIGHT, 178, 24, this, "health", 0, this.health, true);
			_hpBar.dirty = true;
			FlxG.state.add(_hpBar);
		}
		
		public function damageTower(value:Number):void
		{
			this.health -= value;
		}
		
	}

}